MonitorNavTable = function(rsp){
	this.rsp = rsp;
	this.web = {};
	this.web.isCheck = true;
};

MonitorNavTable.prototype = {
	load:function(){
		this.remove();
		var div = this.getHead()+this.getBody();
		$("#"+this.web.divId).append(div);
	},
	refresh:function(){
		this.load();
	},
	remove:function(){
		$("#"+this.web.divId+" thead").remove();
		$("#"+this.web.divId+" tbody").remove();
	},
	/* 获取体信息 */
	getBody:function(){
		var div ='';
		
		div += '<tbody>';
		
		for(var j=0; j<this.rsp[0].tbody.length;j++){
			
			div += '<tr class="unread checked">';
			//页面多选
			if(this.web.isCheck){
				div += '<td class="hidden-xs"><input type="checkbox" name="checkname" class="checkbox"></td>';
			}
			
			for(var i=0;i<this.rsp[0].thead.length;i++){
				 var id = this.rsp[0].thead[i].id.toLowerCase();
				 var value = eval("this.rsp[0].tbody["+j+"]."+id);
				 div += '<td class="'+this.rsp[0].thead[i].id+'">'
				        + value
				        +'</td>';	
			}
			
			div += '</tr>';
		}	
		
		div += '</tbody>';
		
		return div;
	},
	
	/* 获取头信息 */
	getHead:function(){
		var div ='';
		
		div += '<thead>';
		
		div += '<tr class="warning">';
		//页面多选
		if(this.web.isCheck){
			div += '<td class="hidden-xs"><input type="checkbox" class="checkbox allcheck"></td>';
		}
		
		for(var i=0;i<this.rsp[0].thead.length;i++){
			 div += '<td>'+this.rsp[0].thead[i].value+'</td>';	
		}
		
		div += '</tr>';
		
		div += '</thead>';
		
		return div;
	},
	
	/* 传入页面参数 */
	setWeb:function(web){
		this.web = web;		
	}
};